#include <memory>

#include <logger.h>

int main()
{
    std::shared_ptr<int> strong0 = nullptr;
    std::shared_ptr<int> strong1 = std::make_shared<int>(1);
    std::shared_ptr<int> strong2 = std::make_shared<int>(2);
    std::shared_ptr<int> strong22 = strong2;

    VALUE_LOGGER(strong0.use_count()); // 0
    VALUE_LOGGER(strong1.use_count()); // 1
    VALUE_LOGGER(strong2.use_count()); // 2

    std::weak_ptr<int> weak0 = {};
    std::weak_ptr<int> weak10 = strong0;
    std::weak_ptr<int> weak11 = strong1;
    std::weak_ptr<int> weak12 = strong2;
    std::weak_ptr<int> weak2 = strong2;
    std::weak_ptr<int> weak22 = weak12;

    VALUE_LOGGER(weak0.expired()); // true
    VALUE_LOGGER(weak10.expired()); // true
    VALUE_LOGGER(weak11.expired()); // false
    VALUE_LOGGER(weak12.expired()); // false
    VALUE_LOGGER(weak2.expired()); // false
    VALUE_LOGGER(weak22.expired()); // false

    VALUE_LOGGER((weak0.lock() == nullptr)); // true
    VALUE_LOGGER((weak10.lock() == nullptr)); // true
    VALUE_LOGGER((weak11.lock() == nullptr)); // false
    VALUE_LOGGER((weak12.lock() == nullptr)); // false
    VALUE_LOGGER((weak2.lock() == nullptr)); // false
    VALUE_LOGGER((weak22.lock() == nullptr)); // false
    return 0;
}
